<template>
  <div>
    <Header />
    <router-view></router-view>
    <Footer
      v-show="!($route.path.includes('login') || $route.path.includes('register'))"
    />
  </div>
</template>

<script>
import Header from "@components/Header";
import Footer from "@components/Footer";
import { mapActions } from "vuex";

export default {
  name: "App",
  components: {
    Header,
    Footer,
  },
  methods: {
    ...mapActions("NavType", ["categoryListAction"]),
  },
  mounted() {
    // 将 NavType 组件的请求数据操作放到 APP 中，防止多次加载 Navtype 组件请求多次
    this.categoryListAction();
  },
};
</script>

<style>
</style>
